<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">

    <ui:define name="title">
        ContextMenu <span class="subitem">Target</span>
    </ui:define>

    <ui:define name="description">
        ContextMenu can be attached to any component, right-click on ImageSwitch component for options.
    </ui:define>

    <ui:param name="documentationLink" value="/components/contextmenu"/>
    <ui:param name="widgetLink" value="ContextMenu-1"/>

    <ui:define name="implementation">
        <div class="card">
            <p:imageSwitch id="images" effect="fade" widgetVar="gallery" slideshowAuto="false" styleClass="shadow-2">
                <p:graphicImage name="/demo/images/nature/nature1.jpg"/>
                <p:graphicImage name="/demo/images/nature/nature2.jpg"/>
                <p:graphicImage name="/demo/images/nature/nature3.jpg"/>
                <p:graphicImage name="/demo/images/nature/nature4.jpg"/>
            </p:imageSwitch>

            <p:contextMenu for="images">
                <p:menuitem value="Prev" url="javascript:void(0)" onclick="PF('gallery').previous()"
                            icon="pi pi-chevron-left"/>
                <p:menuitem value="Next" url="javascript:void(0)" onclick="PF('gallery').next()"
                            icon="pi pi-chevron-right"/>
                <p:menuitem value="Remove" url="javascript:void(0)" onclick="PF('gallery').getJQ().fadeOut()"
                            icon="pi pi-times"/>
            </p:contextMenu>
        </div>
    </ui:define>

</ui:composition>
